	<?php
		echo $this->Html->css('../plugins/fancybox/jquery.fancybox-1.3.4');
		
		echo $this->Html->script('../plugins/fancybox/jquery.mousewheel-3.0.4.pack');
		echo $this->Html->script('../plugins/fancybox/jquery.fancybox-1.3.4.pack');
	?>
<div id="content">
				<!-- main news -->
				<div id="page-title"><?php echo $datacat[$uses[1]]['title']?></div>
				<?php foreach($data as $k=>$v){?>
				<a rel="gallery1" title="<?php echo $v[$uses[0]]['title']?>" class="fancy" href="<?php echo $this->Seo->link('/images/detail/'.$v[$uses[0]]['id']);?>">
				<div class="item">
					<div style="background-color:#E9E9E9;width:179px;height:117px;">
					<img src="<?php echo empty($v[$uses[0]]['image'])?$this->webroot.'img/thumb_noimg.jpg':$this->webroot.'uploaded/'.$uses[0].'/thumb/'.$v[$uses[0]]['image'];?>" id="main-news-img<?php echo $v[$uses[0]]['id']?>" />
					</div>
					<script type="text/javascript">
						document.getElementById("main-news-img<?php echo $v[$uses[0]]['id']?>").onload = function () {
							var newSize = new resizeImage(this.width,this.height,179,117);
							this.width=newSize.width;
							this.height=newSize.height;
							this.style.marginLeft=((179-newSize.width)/2)+"px";
							this.style.marginTop=((117-newSize.height)/2)+"px";
							this.style.backgroundColor="red";

						}
					</script>
					<center><div id="title"><?php echo $v[$uses[0]]['title']?></div></center>
				</div>
				</a>
				<?php if(($k+1)%5==0) echo '<div style="clear:both"></div>';?>
				<?php }?>
				
				<div style="clear:both;height:20px;"></div>	
				<div>
					<div style="float:left;"><g:plusone size="medium" annotation="none"></g:plusone></div>
					<div style="float:left;margin-left:10px;" class="fb-like" data-href="<?php echo $this->Seo->link('/images/index/'.$datacat[$uses[1]]['id']);?>" data-send="false" data-layout="button_count" data-width="10" data-show-faces="true"></div>
					<div  id="fbfacepile">
						<fb:facepile href="<?php echo $this->Seo->link('/images/index/'.$datacat[$uses[1]]['id']);?>" width="300" max_rows="1"></fb:facepile>
					</div>
					<div style="clear:both;height:5px;"></div>
				</div>	
				
				<br />				
				<div class="fb-comments" data-href="<?php echo $this->Seo->link('/images/index/'.$data[$uses[1]]['id']);?>" data-num-posts="<?php echo $webConfig['fbCommentNop']?>" data-width="650"></div>				
				<div id="fb-root"></div>
				
				<div style="clear:both;height:20px"></div>
				
			</div>
			<script type="text/javascript">
			//google
			  (function() {
			    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
			    po.src = 'https://apis.google.com/js/plusone.js';
			    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
			  })();
			//facebook
			//for fb
			var accessToken;
			var uid;
			  window.fbAsyncInit = function() {
			      FB.init({
			        appId      : '204609776328294', // App ID
			        status     : true, // check login status
			        cookie     : true, // enable cookies to allow the server to access the session
			        xfbml      : true  // parse XFBML
			      });

			  
			      

			      

			      
			    };

			   
			    (function(d){
			        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
			        js = d.createElement('script'); js.id = id; js.async = true;
			        js.src = "//connect.facebook.net/en_US/all.js";
			        d.getElementsByTagName('head')[0].appendChild(js);
			      }(document));
			
			/*
$("a.fancy").fancybox({
	'width'				: '100%',
	'height'			: '100%',
	'nextClick'			:true, 
	'autoScale'			: false,
	'transitionIn'		: 'none',
	'transitionOut'		: 'none'
		
	
});
*/
</script>